<?php

namespace Modules\Order\Entities;

use Modules\Core\Entities\BaseEntity as Model;
use ThrowException;

class OrderAddress extends Model
{
    protected $guarded = [];
    protected $table = 'order_address';

    static public function initWith($address) {
        $item = new OrderAddress();

        $attrs = [
            'area_code',
            'country',
            'province',
            'city',
            'district',
            'address',
            'consignee',
            'phone',
            'tel',
            'zipcode'
        ];
        copyAttrs($item, $address, $attrs);

        $item->uuid = uniqid();

        return $item;
    }
}
